----------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  d:\dab\Dropbox\Documents\CSDP\Black Suffrage\FinalFiles\code\LogBlackSuffrage.log
  log type:  text
 opened on:  26 Feb 2019, 08:20:28

. 
. version 13.1

. set more off

. 
. ********************************************************************************
. *** Generate Figure 1: Qualifications for Male Voting, 1780-1920
. ***
. ***
. *** Figure 1
. 
. ** Exclude more minor disenfranchisements during first wave of Redemption
. use "FinalFiles\SuffrageQualifications.dta", clear
(Dataset summarizing patterns of suffrage qualifications)

. replace raceChange = 0 if (year>=1871 & year<=1880 ) 
(4 real changes made)

. 
. ** Provide indicators for yearly changes
. gen state               = "Delaware" if year==1792
(140 missing values generated)

. replace state   = "Kentucky" if year==1799
(1 real change made)

. replace state   = "Maryland" if year==1801
(1 real change made)

. replace state   = "Ohio"         if year==1803
(1 real change made)

. replace state   = "New Jersey" if year==1807
state was str8 now str10
(1 real change made)

. replace state   = "Indiana and Mississippi Territory" if year==1808
state was str10 now str33
(1 real change made)

. replace state   = "Illinois Territory" if year==1811
(1 real change made)

. replace state   = "Louisiana" if year==1812
(1 real change made)

. replace state   = "Missouri Territory" if year==1813
(1 real change made)

. replace state   = "Connecticut" if year==1814
(1 real change made)

. replace state   = "Michigan Territory" if year==1819
(1 real change made)

. replace state   = "New York" if year==1821
(1 real change made)

. replace state   = "Rhode Island" if year==1822
(1 real change made)

. replace state   = "Tennessee" if year==1834
(1 real change made)

. replace state   = "North Carolina" if year==1836
(1 real change made)

. replace state   = "Pennsylvania" if year==1838
(1 real change made)

. replace state   = "Rhode Island" if year==1842
(1 real change made)

. replace state   = "Wisconsin" if year==1866
(1 real change made)

. replace state   = "Nebraska and Territories" if year==1867
(1 real change made)

. replace state   = "Reconstruction Constitutions and Iowa" if year==1868
state was str33 now str37
(1 real change made)

. replace state   = "Reconstruction Constitutions and Minnesota" if year==1869
state was str37 now str42
(1 real change made)

. replace state   = "15th Amendment" if year==1870
(1 real change made)

. replace state   = "Florida and Tennessee" if year==1889
(1 real change made)

. replace state   = "Mississippi" if year==1890
(1 real change made)

. replace state   = "Louisiana" if year==1894
(1 real change made)

. replace state   = "South Carolina" if year==1896
(1 real change made)

. replace state   = "Arkansas" if year==1897
(1 real change made)

. replace state   = "North Carolina" if year==1900
(1 real change made)

. replace state   = "Alabama" if year==1901
(1 real change made)

. replace state   = "Virginia" if year==1902
(1 real change made)

. replace state   = "Texas" if year==1903
(1 real change made)

. replace state   = "Georgia" if year==1907
(1 real change made)

. replace state   = "Oklahoma" if year==1910
(1 real change made)

. 
. 
. 
. *** Make figure of changes along Property and Race dimensions
. twoway  (line perEffectiveProperty year, lc(black) lw(medthin) lp(solid ) connect(J)) ///
>                 (line perWhiteSupremacy year, ///
>                         connect(J) lc(black) lw(medthin) lp(shortdash) connect(J)) ///
>                 (scatter perWhiteSupremacy year if raceChange!=0 & (year!=1842 & year!=1866 & year!=1867 & year!=1868 & year!=1869 & year!=1
> 870), ///
>                         msy(o) mlw(vthin) mcol(white) mlc(black) ///
>                         lc(black) lw(thin) lp(solid) mlab(state) mlabsize(vsmall) mlabcol(black) mlabpos(4)) ///
>                 (scatter perWhiteSupremacy year if (year==1842 | year==1866 | year==1867 | year==1868 | year==1869 | year==1870), ///
>                         msy(o) mlw(vthin) mcol(black) ///
>                         lc(black) lw(thin) lp(solid) mlab(state) mlabsize(vsmall) mlabcol(black) mlabpos(10)) ///
>                 , graphregion(color(white)) xtitle("", size(vsmall)) ///
>                 ytitle("Percent of States and Territories with Qualification", size(small)) ///
>                 ylab(#10, nogrid angle(h) labsize(vsmall)) ///
>                 xlab(#20, angle(h) labsize(vsmall)) ///
>                 yscale(range(0 100) )   xscale(range(`first_year' `last_year') )                        ///
>                 title("Figure 1: Qualifications for Male Voting, 1780-1920", ///
>                         size(small) color(black)) ///
>                 legend(order(1 2 3 4 5)  col(5)         ///
>                         label(1 "Property""Qualification") ///
>                         label(2 "Race""Qualification") ///
>                         label(3 "Black""Disfranchisement") ///
>                         label(4 "Black""Re-Enfranchisement") ///
>                         size(vsmall) keygap(tiny) rowgap(tiny)  ///
>                         colgap(tiny) symxsize(huge) region(color(none) fcolor(none)))   ///
>                 name(figure1, replace)

. 
. graph export "FinalFiles\Figures\Figure1.eps", replace
(file FinalFiles\Figures\Figure1.eps written in EPS format)

. ********************************************************************************
. *** Using SuffrageVotes.dta file, generate Tables 1 and 2 and Figures 3-4
. ***
. ***
. *** Figure 3
. use "FinalFiles\SuffrageVotes.dta", clear
(File contains recovered voting records on black suffrage, 1785-1868)

. 
. gen id = _n

. reshape long bsuff, i(id) j(new)
(note: j = 1 2)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                     5231   ->   10462
Number of variables                  20   ->      20
j variable (2 values)                     ->   new
xij variables:
                          bsuff1 bsuff2   ->   bsuff
-----------------------------------------------------------------------------

. drop if bsuff==.
(6073 observations deleted)

. 
. 
. *** Generate five year intervals
. gen fiveYr = int(year/5)*5

. 
. ** Generate Panel (a) of Figure 3
. preserve 

.         ** Separate Democratic-Republicans and Democrats
.         replace partyGrp = 9 if partyGrp==1 & year<=1825
(575 real changes made)

.         ** Do not include Unionists or Third Parties to simplify graph
.         drop if partyGrp == 3 | partyGrp==6
(407 observations deleted)

.         regress bsuff i.fiveYr##i.partyGrp  i.icpsrstate i.new
note: 9.partyGrp omitted because of collinearity
note: 1785b.fiveYr#1b.partyGrp identifies no observations in the sample
note: 1785b.fiveYr#2.partyGrp identifies no observations in the sample
note: 1785b.fiveYr#5.partyGrp identifies no observations in the sample
note: 1800.fiveYr#1b.partyGrp identifies no observations in the sample
note: 1800.fiveYr#2.partyGrp identifies no observations in the sample
note: 1800.fiveYr#5.partyGrp identifies no observations in the sample
note: 1800.fiveYr#9.partyGrp omitted because of collinearity
note: 1810.fiveYr#1b.partyGrp identifies no observations in the sample
note: 1810.fiveYr#2.partyGrp identifies no observations in the sample
note: 1810.fiveYr#5.partyGrp identifies no observations in the sample
note: 1810.fiveYr#9.partyGrp omitted because of collinearity
note: 1820.fiveYr#1b.partyGrp identifies no observations in the sample
note: 1820.fiveYr#2.partyGrp identifies no observations in the sample
note: 1820.fiveYr#5.partyGrp identifies no observations in the sample
note: 1820.fiveYr#9.partyGrp omitted because of collinearity
note: 1830.fiveYr#4.partyGrp identifies no observations in the sample
note: 1830.fiveYr#5.partyGrp identifies no observations in the sample
note: 1830.fiveYr#9.partyGrp identifies no observations in the sample
note: 1835.fiveYr#4.partyGrp identifies no observations in the sample
note: 1835.fiveYr#5.partyGrp identifies no observations in the sample
note: 1835.fiveYr#9.partyGrp identifies no observations in the sample
note: 1840.fiveYr#4.partyGrp identifies no observations in the sample
note: 1840.fiveYr#5.partyGrp identifies no observations in the sample
note: 1840.fiveYr#9.partyGrp identifies no observations in the sample
note: 1845.fiveYr#4.partyGrp identifies no observations in the sample
note: 1845.fiveYr#5.partyGrp identifies no observations in the sample
note: 1845.fiveYr#9.partyGrp identifies no observations in the sample
note: 1850.fiveYr#4.partyGrp identifies no observations in the sample
note: 1850.fiveYr#5.partyGrp identifies no observations in the sample
note: 1850.fiveYr#9.partyGrp identifies no observations in the sample
note: 1855.fiveYr#2.partyGrp omitted because of collinearity
note: 1855.fiveYr#4.partyGrp identifies no observations in the sample
note: 1855.fiveYr#9.partyGrp identifies no observations in the sample
note: 1860.fiveYr#2.partyGrp identifies no observations in the sample
note: 1860.fiveYr#4.partyGrp identifies no observations in the sample
note: 1860.fiveYr#9.partyGrp identifies no observations in the sample
note: 1865.fiveYr#2.partyGrp identifies no observations in the sample
note: 1865.fiveYr#4.partyGrp identifies no observations in the sample
note: 1865.fiveYr#5.partyGrp omitted because of collinearity
note: 1865.fiveYr#9.partyGrp identifies no observations in the sample

      Source |       SS       df       MS              Number of obs =    3784
-------------+------------------------------           F( 59,  3724) =   43.20
       Model |  371.447818    59  6.29572573           Prob > F      =  0.0000
    Residual |  542.731622  3724  .145738889           R-squared     =  0.4063
-------------+------------------------------           Adj R-squared =  0.3969
       Total |   914.17944  3783  .241654623           Root MSE      =  .38176

----------------------------------------------------------------------------------
           bsuff |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
          fiveYr |
           1800  |  -.0023954   .0753677    -0.03   0.975    -.1501614    .1453706
           1810  |   .0122568   .0669131     0.18   0.855    -.1189331    .1434468
           1820  |  -.2596331   .0606215    -4.28   0.000    -.3784878   -.1407785
           1830  |   .0268646   .0993565     0.27   0.787    -.1679339    .2216631
           1835  |  -.4611216   .0677669    -6.80   0.000    -.5939853   -.3282578
           1840  |  -.5687843   .0818552    -6.95   0.000    -.7292697    -.408299
           1845  |  -.3517674   .0630872    -5.58   0.000    -.4754561   -.2280786
           1850  |  -.4047304   .0666819    -6.07   0.000    -.5354671   -.2739938
           1855  |  -.5170303   .0659831    -7.84   0.000    -.6463969   -.3876637
           1860  |  -.4758177   .0776516    -6.13   0.000    -.6280615    -.323574
           1865  |  -.4329539   .0657717    -6.58   0.000    -.5619059   -.3040019
                 |
        partyGrp |
           Whig  |   .6539063   .1025398     6.38   0.000     .4528667     .854946
     Federalist  |  -.2411014   .1126539    -2.14   0.032    -.4619707   -.0202321
     Republican  |   .8978409   .0360044    24.94   0.000     .8272506    .9684311
              9  |          0  (omitted)
                 |
 fiveYr#partyGrp |
1785#Democratic  |          0  (empty)
      1785#Whig  |          0  (empty)
1785#Republican  |          0  (empty)
1800#Democratic  |          0  (empty)
      1800#Whig  |          0  (empty)
1800#Federalist  |   .2044354    .128985     1.58   0.113    -.0484528    .4573236
1800#Republican  |          0  (empty)
         1800 9  |          0  (omitted)
1810#Democratic  |          0  (empty)
      1810#Whig  |          0  (empty)
1810#Federalist  |   .1414171   .1242411     1.14   0.255    -.1021701    .3850043
1810#Republican  |          0  (empty)
         1810 9  |          0  (omitted)
1820#Democratic  |          0  (empty)
      1820#Whig  |          0  (empty)
1820#Federalist  |   .6666966    .129852     5.13   0.000     .4121087    .9212845
1820#Republican  |          0  (empty)
         1820 9  |          0  (omitted)
      1830#Whig  |  -.6237813    .125392    -4.97   0.000    -.8696251   -.3779376
1830#Federalist  |          0  (empty)
1830#Republican  |          0  (empty)
         1830 9  |          0  (empty)
      1835#Whig  |  -.5719349   .1101582    -5.19   0.000    -.7879112   -.3559585
1835#Federalist  |          0  (empty)
1835#Republican  |          0  (empty)
         1835 9  |          0  (empty)
      1840#Whig  |  -.3965976   .1219251    -3.25   0.001    -.6356441   -.1575512
1840#Federalist  |          0  (empty)
1840#Republican  |          0  (empty)
         1840 9  |          0  (empty)
      1845#Whig  |  -.3021806   .1077219    -2.81   0.005    -.5133802    -.090981
1845#Federalist  |          0  (empty)
1845#Republican  |          0  (empty)
         1845 9  |          0  (empty)
      1850#Whig  |  -.2262432    .108392    -2.09   0.037    -.4387566   -.0137298
1850#Federalist  |          0  (empty)
1850#Republican  |          0  (empty)
         1850 9  |          0  (empty)
      1855#Whig  |          0  (omitted)
1855#Federalist  |          0  (empty)
1855#Republican  |  -.2329157   .0561542    -4.15   0.000    -.3430117   -.1228197
         1855 9  |          0  (empty)
      1860#Whig  |          0  (empty)
1860#Federalist  |          0  (empty)
1860#Republican  |  -.0052593   .0778817    -0.07   0.946    -.1579542    .1474357
         1860 9  |          0  (empty)
      1865#Whig  |          0  (empty)
1865#Federalist  |          0  (empty)
1865#Republican  |          0  (omitted)
         1865 9  |          0  (empty)
                 |
      icpsrstate |
              2  |  -.1072095    .084291    -1.27   0.203    -.2724705    .0580515
              3  |  -.0546023   .0523505    -1.04   0.297    -.1572409    .0480362
              4  |  -.0594616   .0810173    -0.73   0.463    -.2183043    .0993811
              5  |  -.1507572     .10656    -1.41   0.157    -.3596789    .0581644
              6  |  -.0838089   .0810916    -1.03   0.301    -.2427972    .0751794
             11  |  -.4186655   .1209544    -3.46   0.001    -.6558088   -.1815222
             12  |  -.1410817   .0423368    -3.33   0.001    -.2240872   -.0580762
             13  |  -.0564673   .0298554    -1.89   0.059    -.1150019    .0020673
             14  |  -.0321228   .0330642    -0.97   0.331    -.0969486     .032703
             21  |  -.3410702   .0352265    -9.68   0.000    -.4101354    -.272005
             22  |  -.3762752   .0363327   -10.36   0.000    -.4475091   -.3050413
             23  |  -.0902401   .0350831    -2.57   0.010     -.159024   -.0214562
             24  |  -.2879101   .0369108    -7.80   0.000    -.3602774   -.2155428
             25  |  -.0923531   .0322672    -2.86   0.004    -.1556162   -.0290899
             31  |  -.1445769   .0814054    -1.78   0.076    -.3041804    .0150266
             32  |  -.4963283    .064235    -7.73   0.000    -.6222674   -.3703891
             33  |  -.3334502   .0448266    -7.44   0.000    -.4213372   -.2455632
             34  |  -.3576843   .0735833    -4.86   0.000    -.5019518   -.2134167
             35  |  -.6107491   .1929858    -3.16   0.002    -.9891174   -.2323809
             40  |  -.4548076   .0731098    -6.22   0.000    -.5981467   -.3114685
             41  |  -.0848565   .1382184    -0.61   0.539    -.3558477    .1861346
             42  |  -.4268207   .1585532    -2.69   0.007    -.7376804   -.1159611
             43  |  -.0934874    .271512    -0.34   0.731    -.6258141    .4388393
             44  |  -.1598647   .0904506    -1.77   0.077    -.3372023    .0174729
             45  |   -.144567   .1930592    -0.75   0.454     -.523079    .2339451
             47  |  -.2352091   .0637084    -3.69   0.000    -.3601159   -.1103024
             48  |  -.3305237   .0842978    -3.92   0.000     -.495798   -.1652494
             51  |  -.2628791   .0727685    -3.61   0.000    -.4055491    -.120209
             52  |  -.3902535   .0543552    -7.18   0.000    -.4968223   -.2836847
             54  |  -.2933433   .0693309    -4.23   0.000    -.4292734   -.1574131
             56  |  -.0934874   .1930907    -0.48   0.628    -.4720613    .2850866
             65  |  -.7045769   .1730464    -4.07   0.000    -1.043852   -.3653019
             71  |  -.1324052   .1094519    -1.21   0.226    -.3469968    .0821864
             72  |  -1.088954   .2224907    -4.89   0.000     -1.52517   -.6527386
                 |
           2.new |   -.069047   .0192658    -3.58   0.000    -.1068195   -.0312745
           _cons |   .6631239   .0628528    10.55   0.000     .5398946    .7863533
----------------------------------------------------------------------------------

.         levelsof partyC
1 10 13 14 29 39 100 112 200 206 331 999 1116 9999

.         margins, over(i.fiveYr i.partyGrp )

Predictive margins                                Number of obs   =       3784
Model VCE    : OLS

Expression   : Linear prediction, predict()
over         : fiveYr partyGrp

----------------------------------------------------------------------------------
                 |            Delta-method
                 |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
 fiveYr#partyGrp |
1785#Federalist  |   .3333333   .0985694     3.38   0.001     .1400781    .5265886
         1785 9  |   .5714286   .0545368    10.48   0.000     .4645036    .6783535
1800#Federalist  |   .3559322   .0497006     7.16   0.000     .2584891    .4533753
         1800 9  |   .4495413   .0365657    12.29   0.000     .3778504    .5212321
1810#Federalist  |   .3953488    .041166     9.60   0.000     .3146388    .4760589
         1810 9  |    .430622   .0264067    16.31   0.000     .3788489    .4823951
1820#Federalist  |   .7380952   .0589065    12.53   0.000     .6226031    .8535874
         1820 9  |      .3125   .0264701    11.81   0.000     .2606026    .3643974
1830#Democratic  |   .4444444   .0569091     7.81   0.000     .3328685    .5560204
      1830#Whig  |    .472973   .0443784    10.66   0.000     .3859646    .5599814
1835#Democratic  |   .1382488   .0259154     5.33   0.000     .0874391    .1890586
      1835#Whig  |   .2690355   .0271991     9.89   0.000     .2157089    .3223621
1840#Democratic  |   .0943396   .0524384     1.80   0.072    -.0084713    .1971505
      1840#Whig  |   .3516484   .0400191     8.79   0.000     .2731869    .4301098
1845#Democratic  |   .1810345   .0204644     8.85   0.000      .140912    .2211569
      1845#Whig  |   .5410628    .026534    20.39   0.000     .4890402    .5930854
1850#Democratic  |   .0719697   .0234956     3.06   0.002     .0259043    .1180351
      1850#Whig  |   .5525114   .0257968    21.42   0.000     .5019342    .6030886
1855#Democratic  |   .0995025   .0269271     3.70   0.000     .0467092    .1522958
      1855#Whig  |         .8   .0985694     8.12   0.000     .6067447    .9932553
1855#Republican  |   .5738397   .0247978    23.14   0.000      .525221    .6224583
1860#Democratic  |   1.11e-15    .050565     0.00   1.000    -.0991379    .0991379
1860#Republican  |   .9264706   .0462949    20.01   0.000     .8357047    1.017236
1865#Democratic  |   .0233918   .0291937     0.80   0.423    -.0338455    .0806291
1865#Republican  |   .9152855   .0163828    55.87   0.000     .8831653    .9474056
----------------------------------------------------------------------------------

.         marginsplot,                                                                                                                    ///
>                 recast(line) recastci(rline)                                                                            ///
>                 ci1opts(lw(vthin) lc(black) lp(solid))                                                          ///
>                 ci2opts(lw(vthin) lc(black) lp(dash))                                                           ///
>                 ci3opts(lw(vthin) lcol(black) lp(shortdash))                                            ///
>                 ci4opts(lw(vthin) lcol(black) lp(shortdash_dot))                                        ///
>                 ci5opts(lw(vthin) lcol(black) lp(solid))                                                        ///
>                 plot1opts(lw(medthick) lc(black) lp(solid))                                                     ///
>                 plot2opts(lw(medthick) lc(black) lp(dash))                                                      ///
>                 plot3opts(lw(medthick) lc(black) lp(shortdash))                                         ///
>                 plot4opts(lw(medthick) lc(black) lp(shortdash_dot))                                     ///
>                 plot5opts(lw(medthick) lc(black) lp(solid))                                                     ///
>                 ylabel(,labsize(small) angle(h) nogrid)                                                         ///
>                 xlabel(1785(10)1865, angle(h) labsize(small))                                           ///
>                 graphregion(col(white))                                                                                         ///
>                 ytitle("Probability of Voting for Black Suffrage", size(small))         ///
>                 xtitle("") title("Support for Black Suffrage by Party", size(small) col(black)) ///
>                 legend(row(2) size(small) region(col(none)) lcol(none)  symxsize(10) ///
>                         order(6 8 7 9 ) label(6 "Democratic-Republicans/Democrats")     ///
>                         label(7 "Whigs") label(8 "Federalists") label(9 "Republicans") ) ///
>                 name(figure3a, replace)

  Variables that uniquely identify margins: fiveYr partyGrp

. restore

.         
. ** Generate Panel (b) of Figure 3
. preserve

.         ** Separate first- and second-party period
.         replace bsuff = 2 if bsuff==0 & year>=1830
(1970 real changes made)

.         replace bsuff = 3 if bsuff==1 & year>=1830
(1615 real changes made)

. 
.         qreg ideal i.fiveY##i.bsuff 
note: 3.bsuff omitted because of collinearity
note: 1785.fiveYr#2.bsuff identifies no observations in the sample
note: 1785.fiveYr#3.bsuff identifies no observations in the sample
note: 1800.fiveYr#2.bsuff identifies no observations in the sample
note: 1800.fiveYr#3.bsuff identifies no observations in the sample
note: 1810.fiveYr#2.bsuff identifies no observations in the sample
note: 1810.fiveYr#3.bsuff identifies no observations in the sample
note: 1820.fiveYr#2.bsuff identifies no observations in the sample
note: 1820.fiveYr#3.bsuff identifies no observations in the sample
note: 1830.fiveYr#0.bsuff identifies no observations in the sample
note: 1830.fiveYr#1.bsuff identifies no observations in the sample
note: 1830.fiveYr#3.bsuff omitted because of collinearity
note: 1835.fiveYr#0.bsuff identifies no observations in the sample
note: 1835.fiveYr#1.bsuff identifies no observations in the sample
note: 1835.fiveYr#3.bsuff omitted because of collinearity
note: 1840.fiveYr#0.bsuff identifies no observations in the sample
note: 1840.fiveYr#1.bsuff identifies no observations in the sample
note: 1840.fiveYr#3.bsuff omitted because of collinearity
note: 1845.fiveYr#0.bsuff identifies no observations in the sample
note: 1845.fiveYr#1.bsuff identifies no observations in the sample
note: 1845.fiveYr#3.bsuff omitted because of collinearity
note: 1850.fiveYr#0.bsuff identifies no observations in the sample
note: 1850.fiveYr#1.bsuff identifies no observations in the sample
note: 1850.fiveYr#3.bsuff omitted because of collinearity
note: 1855.fiveYr#0.bsuff identifies no observations in the sample
note: 1855.fiveYr#1.bsuff identifies no observations in the sample
note: 1855.fiveYr#3.bsuff omitted because of collinearity
note: 1860.fiveYr#0.bsuff identifies no observations in the sample
note: 1860.fiveYr#1.bsuff identifies no observations in the sample
note: 1860.fiveYr#3.bsuff omitted because of collinearity
note: 1865.fiveYr#0.bsuff identifies no observations in the sample
note: 1865.fiveYr#1.bsuff identifies no observations in the sample
note: 1865.fiveYr#2.bsuff omitted because of collinearity
note: 1865.fiveYr#3.bsuff omitted because of collinearity
Iteration  1:  WLS sum of weighted deviations =  1374.8038

note: 1785.fiveYr#2.bsuff identifies no observations in the sample
note: 1785.fiveYr#3.bsuff identifies no observations in the sample
note: 1800.fiveYr#2.bsuff identifies no observations in the sample
note: 1800.fiveYr#3.bsuff identifies no observations in the sample
note: 1810.fiveYr#2.bsuff identifies no observations in the sample
note: 1810.fiveYr#3.bsuff identifies no observations in the sample
note: 1820.fiveYr#2.bsuff identifies no observations in the sample
note: 1820.fiveYr#3.bsuff identifies no observations in the sample
note: 1830.fiveYr#0.bsuff identifies no observations in the sample
note: 1830.fiveYr#1.bsuff identifies no observations in the sample
note: 1835.fiveYr#0.bsuff identifies no observations in the sample
note: 1835.fiveYr#1.bsuff identifies no observations in the sample
note: 1840.fiveYr#0.bsuff identifies no observations in the sample
note: 1840.fiveYr#1.bsuff identifies no observations in the sample
note: 1845.fiveYr#0.bsuff identifies no observations in the sample
note: 1845.fiveYr#1.bsuff identifies no observations in the sample
note: 1850.fiveYr#0.bsuff identifies no observations in the sample
note: 1850.fiveYr#1.bsuff identifies no observations in the sample
note: 1855.fiveYr#0.bsuff identifies no observations in the sample
note: 1855.fiveYr#1.bsuff identifies no observations in the sample
note: 1860.fiveYr#0.bsuff identifies no observations in the sample
note: 1860.fiveYr#1.bsuff identifies no observations in the sample
note: 1865.fiveYr#0.bsuff identifies no observations in the sample
note: 1865.fiveYr#1.bsuff identifies no observations in the sample
Iteration  1: sum of abs. weighted deviations =  1374.3937
Iteration  2: sum of abs. weighted deviations =  1371.1303
Iteration  3: sum of abs. weighted deviations =  1369.8174
Iteration  4: sum of abs. weighted deviations =   1367.458
note:  alternate solutions exist
Iteration  5: sum of abs. weighted deviations =  1364.9065
note:  alternate solutions exist
Iteration  6: sum of abs. weighted deviations =  1362.3871
note:  alternate solutions exist
Iteration  7: sum of abs. weighted deviations =  1362.2718
Iteration  8: sum of abs. weighted deviations =  1361.8525
note:  alternate solutions exist
Iteration  9: sum of abs. weighted deviations =  1361.0886
Iteration 10: sum of abs. weighted deviations =  1360.0689
note:  alternate solutions exist
Iteration 11: sum of abs. weighted deviations =  1359.6812
Iteration 12: sum of abs. weighted deviations =  1358.9889
note:  alternate solutions exist
Iteration 13: sum of abs. weighted deviations =  1357.2706
Iteration 14: sum of abs. weighted deviations =   1356.919
note:  alternate solutions exist
Iteration 15: sum of abs. weighted deviations =  1356.4742
note:  alternate solutions exist
Iteration 16: sum of abs. weighted deviations =   1356.366
Iteration 17: sum of abs. weighted deviations =  1356.3026
note:  alternate solutions exist
Iteration 18: sum of abs. weighted deviations =   1356.294
Iteration 19: sum of abs. weighted deviations =   1355.925
Iteration 20: sum of abs. weighted deviations =  1355.7955
Iteration 21: sum of abs. weighted deviations =  1355.7831
Iteration 22: sum of abs. weighted deviations =  1355.7786
Iteration 23: sum of abs. weighted deviations =  1355.7738

Median regression                                    Number of obs =      4247
  Raw sum of deviations 1794.941 (about .17519189)
  Min sum of deviations 1355.774                     Pseudo R2     =    0.2447

------------------------------------------------------------------------------
       ideal |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      fiveYr |
       1800  |    .048507   .1986909     0.24   0.807    -.3410316    .4380456
       1810  |  -.0647176   .1841763    -0.35   0.725    -.4257999    .2963647
       1820  |   -.057031   .1857939    -0.31   0.759    -.4212847    .3072227
       1830  |  -.0479677   .2037593    -0.24   0.814    -.4474431    .3515077
       1835  |   .9197791   .1853679     4.96   0.000     .5563605    1.283198
       1840  |   .7279363   .2442434     2.98   0.003     .2490908    1.206782
       1845  |    .802451   .1809478     4.43   0.000     .4476981    1.157204
       1850  |    .791507   .1845599     4.29   0.000     .4296726    1.153341
       1855  |   .9116865   .1725736     5.28   0.000     .5733514    1.250022
       1860  |   1.204899   .2136562     5.64   0.000     .7860204    1.623778
       1865  |   1.165528   .1699273     6.86   0.000     .8323817    1.498675
             |
       bsuff |
          1  |   -.530401   .2442434    -2.17   0.030    -1.009246   -.0515556
          2  |   -1.60523    .090826   -17.67   0.000    -1.783296   -1.427163
          3  |          0  (omitted)
             |
fiveYr#bsuff |
     1785 2  |          0  (empty)
     1785 3  |          0  (empty)
     1800 1  |     .54145   .3027607     1.79   0.074    -.0521202     1.13502
     1800 2  |          0  (empty)
     1800 3  |          0  (empty)
     1810 1  |   .4617597    .279241     1.65   0.098    -.0856994    1.009219
     1810 2  |          0  (empty)
     1810 3  |          0  (empty)
     1820 1  |   1.203928   .2857417     4.21   0.000     .6437239    1.764132
     1820 2  |          0  (empty)
     1820 3  |          0  (empty)
     1830 0  |          0  (empty)
     1830 1  |          0  (empty)
     1830 2  |   1.821999   .1929803     9.44   0.000     1.443656    2.200342
     1830 3  |          0  (omitted)
     1835 0  |          0  (empty)
     1835 1  |          0  (empty)
     1835 2  |   .6109848   .1419562     4.30   0.000      .332676    .8892936
     1835 3  |          0  (omitted)
     1840 0  |          0  (empty)
     1840 1  |          0  (empty)
     1840 2  |   1.383249   .2313838     5.98   0.000     .9296152    1.836883
     1840 3  |          0  (omitted)
     1845 0  |          0  (empty)
     1845 1  |          0  (empty)
     1845 2  |   .6260625   .1345135     4.65   0.000     .3623453    .8897796
     1845 3  |          0  (omitted)
     1850 0  |          0  (empty)
     1850 1  |          0  (empty)
     1850 2  |   .6497555    .141162     4.60   0.000     .3730038    .9265072
     1850 3  |          0  (omitted)
     1855 0  |          0  (empty)
     1855 1  |          0  (empty)
     1855 2  |  -.1794273   .1297011    -1.38   0.167    -.4337098    .0748551
     1855 3  |          0  (omitted)
     1860 0  |          0  (empty)
     1860 1  |          0  (empty)
     1860 2  |   .0021765   .2095085     0.01   0.992    -.4085704    .4129233
     1860 3  |          0  (omitted)
     1865 0  |          0  (empty)
     1865 1  |          0  (empty)
     1865 2  |          0  (omitted)
     1865 3  |          0  (omitted)
             |
       _cons |   -.208507   .1616814    -1.29   0.197    -.5254876    .1084736
------------------------------------------------------------------------------

.         margins, over(i.fiveY i.bsuff)
Warning: cannot perform check for estimable functions.

Predictive margins                                Number of obs   =       4247
Model VCE    : IID

Expression   : Linear prediction, predict()
over         : fiveYr bsuff

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
fiveYr#bsuff |
     1785 0  |   -.208507   .1616814    -1.29   0.197    -.5253967    .1083827
     1785 1  |   -.738908   .1830681    -4.04   0.000    -1.097715    -.380101
     1800 0  |       -.16   .1154867    -1.39   0.166    -.3863498    .0663498
     1800 1  |   -.148951   .1366457    -1.09   0.276    -.4167717    .1188697
     1810 0  |  -.2732246   .0882044    -3.10   0.002    -.4461021   -.1003471
     1810 1  |  -.3418659   .1026678    -3.33   0.001     -.543091   -.1406407
     1820 0  |   -.265538   .0915341    -2.90   0.004    -.4449415   -.0861345
     1820 1  |    .407989   .1166835     3.50   0.000     .1792935    .6366844
     1830 2  |  -.0397056   .1166835    -0.34   0.734    -.2684011    .1889898
     1830 3  |  -.2564747    .124004    -2.07   0.039     -.499518   -.0134314
     1835 2  |  -.2829729   .0606779    -4.66   0.000    -.4018995   -.1640463
     1835 3  |   .7112721   .0906664     7.84   0.000     .5335692     .888975
     1840 2  |   .2974486   .1085134     2.74   0.006     .0847662    .5101311
     1840 3  |   .5194293   .1830681     2.84   0.005     .1606223    .8782362
     1845 2  |  -.3852234   .0569498    -6.76   0.000     -.496843   -.2736037
     1845 3  |    .593944    .081248     7.31   0.000     .4347009     .753187
     1850 2  |  -.3724743   .0612852    -6.08   0.000     -.492591   -.2523575
     1850 3  |       .583   .0890027     6.55   0.000      .408558    .7574421
     1855 2  |  -1.081478   .0702299   -15.40   0.000    -1.219126   -.9438295
     1855 3  |   .7031795    .060339    11.65   0.000     .5849173    .8214417
     1860 2  |  -.6066613   .1270289    -4.78   0.000    -.8556334   -.3576892
     1860 3  |    .996392   .1396715     7.13   0.000      .722641    1.270143
     1865 2  |  -.6482083   .0742627    -8.73   0.000    -.7937606   -.5026561
     1865 3  |   .9570215   .0522915    18.30   0.000      .854532    1.059511
------------------------------------------------------------------------------

.         marginsplot, recast(line) recastci(rline)                                                               ///
>                 ci1opts(lw(vthin) lc(black) lp(solid))                                                          ///
>                 ci2opts(lw(vthin) lc(black) lp(dash))                                                           ///
>                 ci3opts(lw(vthin) lc(black) lp(solid))                                                          ///
>                 ci4opts(lw(vthin) lc(black) lp(dash))                                                           ///
>                 plot1opts(lw(medthick) lc(black) lp(solid))                                                     ///
>                 plot2opts(lw(medthick) lc(black) lp(dash))                                                      ///
>                 plot3opts(lw(medthick) lc(black) lp(solid))                                                     ///
>                 plot4opts(lw(medthick) lc(black) lp(dash))                                                      ///
>                 ylabel(,labsize(small) angle(h) nogrid)                                                         ///
>                 xlabel(1785(10)1865, angle(h)  labsize(small))                                          ///
>                 graphregion(col(white))                                                                                         ///
>                 ytitle("Ideological Dimension", size(small))                                            ///
>                 xtitle("") title("Median Supporter/Opponent Along Ideological Dimension", size(small) col(black))       ///
>                 legend(row(2) size(small) region(col(none)) lcol(none)  symxsize(10) ///
>                         order(7 8) label(7 "Median Anti-Black Suffrage Legislator")     ///
>                         label(8 "Median Pro-Black Suffrage Legislator")  )                              ///
>                 name(figure3b, replace)

  Variables that uniquely identify margins: fiveYr bsuff

. restore

. 
. graph combine figure3a figure3b, graphreg(col(white)) imargin(vsmall)           ///
>         title("Figure 3: Issue Development on Black Suffrage", size(small) col(black))  ///
>         note("95% confidence intervals shown. Positive values on ideological dimension associated with Federalists, Whigs, and Republicans; 
> negative values with" "Democratic-Republicans and Democrats.", size(vsmall))

. graph export "FinalFiles\Figures\Figure3.eps", replace
(note: file FinalFiles\Figures\Figure3.eps not found)
(file FinalFiles\Figures\Figure3.eps written in EPS format)

. ********************************************************************************
. ***
. ***
. *** 
. *** Table 1
. 
. clear all

. 
. use "FinalFiles\SuffrageVotes.dta", clear
(File contains recovered voting records on black suffrage, 1785-1868)

. 
. gen id = _n

. reshape long bsuff, i(id) j(new)
(note: j = 1 2)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                     5231   ->   10462
Number of variables                  20   ->      20
j variable (2 values)                     ->   new
xij variables:
                          bsuff1 bsuff2   ->   bsuff
-----------------------------------------------------------------------------

. drop if bsuff==.
(6073 observations deleted)

. 
. egen group = group(year chamber)

. xtset group
       panel variable:  group (unbalanced)

. 
. 
. ***********************************************************************************
. eststo drop est*
(no matches found for est*)

. ** Model 1 - 1785-1825 (North)
. eststo: xtreg bsuff i.partyGrp##c.perFPOC ideal perEnslaved electionMargin      ///
>         if year<=1821 & (south==0 & chamber!="HR" & chamber!="SENATE"),                 ///
>         fe vce(boot, reps(500) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (500)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500

Fixed-effects (within) regression               Number of obs      =       413
Group variable: group                           Number of groups   =         4

R-sq:  within  = 0.1450                         Obs per group: min =        36
       between = 0.2973                                        avg =     103.3
       overall = 0.0542                                        max =       246

                                                Wald chi2(6)       =    129.41
corr(u_i, Xb)  = -0.5987                        Prob > chi2        =    0.0000

                                         (Replications based on 4 clusters in group)
------------------------------------------------------------------------------------
                   |   Observed   Bootstrap                         Normal-based
             bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          partyGrp |
       Federalist  |   .0200957   .1591039     0.13   0.899    -.2917422    .3319336
           perFPOC |   .0052158    .023538     0.22   0.825    -.0409178    .0513493
                   |
partyGrp#c.perFPOC |
       Federalist  |   .0095523   .0551174     0.17   0.862    -.0984758    .1175803
                   |
             ideal |   .1201887   .0744486     1.61   0.106    -.0257279    .2661053
       perEnslaved |  -.0406336   .0091401    -4.45   0.000    -.0585479   -.0227193
    electionMargin |  -.3788774   .1858891    -2.04   0.042    -.7432134   -.0145414
             _cons |   .6031059   .1610013     3.75   0.000     .2875492    .9186626
-------------------+----------------------------------------------------------------
           sigma_u |  .23163505
           sigma_e |  .46012109
               rho |  .20219151   (fraction of variance due to u_i)
------------------------------------------------------------------------------------
(est1 stored)

. ** Model 2 - 1785-1825 (South & Congress)
. eststo: xtreg bsuff i.partyGrp##c.perFPOC ideal perEnslaved electionMargin      ///
>         if year<=1821 & (south==1 | chamber=="HR" | chamber=="SENATE"),                 ///
>         fe vce(boot, reps(500) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (500)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500

Fixed-effects (within) regression               Number of obs      =       333
Group variable: group                           Number of groups   =         3

R-sq:  within  = 0.1273                         Obs per group: min =        64
       between = 0.3210                                        avg =     111.0
       overall = 0.1350                                        max =       204

                                                Wald chi2(6)       =   1756.47
corr(u_i, Xb)  = -0.1635                        Prob > chi2        =    0.0000

                                         (Replications based on 3 clusters in group)
------------------------------------------------------------------------------------
                   |   Observed   Bootstrap                         Normal-based
             bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          partyGrp |
       Federalist  |  -.2050414    .200986    -1.02   0.308    -.5989668    .1888839
           perFPOC |  -.0004165   .0101938    -0.04   0.967     -.020396    .0195629
                   |
partyGrp#c.perFPOC |
       Federalist  |  -.0192136   .0170776    -1.13   0.261     -.052685    .0142579
                   |
             ideal |    .074851    .116452     0.64   0.520    -.1533909    .3030928
       perEnslaved |  -.0098949   .0052548    -1.88   0.060    -.0201942    .0004043
    electionMargin |   .1071149   .1470303     0.73   0.466    -.1810592    .3952891
             _cons |   .6206637   .0886792     7.00   0.000     .4468556    .7944718
-------------------+----------------------------------------------------------------
           sigma_u |  .11933484
           sigma_e |  .45316629
               rho |  .06484869   (fraction of variance due to u_i)
------------------------------------------------------------------------------------
(est2 stored)

. ** Model 3 - 1830-1840 (South)
. eststo: reg bsuff i.partyGrp##c.perFPOC ideal perEnslaved i.icpsrstate          ///
>         electionMargin if year>1830 & year<=1840 & south==1, vce(robust)

Linear regression                                      Number of obs =     119
                                                       F(  7,   111) =    7.65
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.2089
                                                       Root MSE      =  .45914

------------------------------------------------------------------------------------
                   |               Robust
             bsuff |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          partyGrp |
             Whig  |   -.059403   .1330057    -0.45   0.656    -.3229626    .2041566
           perFPOC |   .0359746    .067136     0.54   0.593    -.0970599    .1690091
                   |
partyGrp#c.perFPOC |
             Whig  |   .0157709   .0829203     0.19   0.850    -.1485413    .1800831
                   |
             ideal |  -.0620244   .0313601    -1.98   0.050    -.1241665    .0001178
       perEnslaved |  -.0144323   .0032491    -4.44   0.000    -.0208706    -.007994
     54.icpsrstate |  -.3200951   .0964902    -3.32   0.001    -.5112969   -.1288933
    electionMargin |  -.2427037   .2027353    -1.20   0.234    -.6444373    .1590299
             _cons |   1.032126   .1743894     5.92   0.000     .6865617     1.37769
------------------------------------------------------------------------------------
(est3 stored)

. ** Model 4 - 1830-1855 (North)
. eststo: xtreg bsuff i.partyGrp##c.perFPOC ideal perLibertyFS electionMargin     ///
>         if year>1830 & year<=1855, fe vce(boot, reps(500) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (500)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500

Fixed-effects (within) regression               Number of obs      =      1840
Group variable: group                           Number of groups   =        16

R-sq:  within  = 0.2996                         Obs per group: min =        25
       between = 0.0840                                        avg =     115.0
       overall = 0.2644                                        max =       230

                                                Wald chi2(8)       =    209.28
corr(u_i, Xb)  = -0.0257                        Prob > chi2        =    0.0000

                                        (Replications based on 16 clusters in group)
------------------------------------------------------------------------------------
                   |   Observed   Bootstrap                         Normal-based
             bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          partyGrp |
             Whig  |   .1910206   .0671767     2.84   0.004     .0593567    .3226846
      Third-Party  |   .4710477   .1441885     3.27   0.001     .1884434     .753652
                   |
           perFPOC |   .0055656   .0094765     0.59   0.557    -.0130079    .0241391
                   |
partyGrp#c.perFPOC |
             Whig  |  -.0009321   .0160469    -0.06   0.954    -.0323835    .0305193
      Third-Party  |   .0023404   .0774869     0.03   0.976    -.1495312    .1542119
                   |
             ideal |   .1012333   .0335141     3.02   0.003     .0355468    .1669198
      perLibertyFS |   .0089455   .0024815     3.60   0.000     .0040818    .0138092
    electionMargin |   .0344922   .0770557     0.45   0.654    -.1165341    .1855185
             _cons |    .131394    .056065     2.34   0.019     .0215087    .2412793
-------------------+----------------------------------------------------------------
           sigma_u |  .19275869
           sigma_e |   .3588427
               rho |  .22393333   (fraction of variance due to u_i)
------------------------------------------------------------------------------------
(est4 stored)

. ** Model 5 - 1830-1855 (North) 
. eststo: xtreg bsuff i.partyGrp##c.perFPOC ideal  perLibertyFS electionMargin ///
>         perMfg if year>1830 & year<=1855, fe vce(boot, reps(500) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (500)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................x...............................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500

Fixed-effects (within) regression               Number of obs      =      1487
Group variable: group                           Number of groups   =        13

R-sq:  within  = 0.3283                         Obs per group: min =        25
       between = 0.0079                                        avg =     114.4
       overall = 0.2765                                        max =       222

                                                Wald chi2(9)       =    209.72
corr(u_i, Xb)  = -0.0884                        Prob > chi2        =    0.0000

                                        (Replications based on 13 clusters in group)
------------------------------------------------------------------------------------
                   |   Observed   Bootstrap                         Normal-based
             bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          partyGrp |
             Whig  |   .2547029   .0688376     3.70   0.000     .1197837    .3896221
      Third-Party  |   .4584796   .1293232     3.55   0.000     .2050108    .7119483
                   |
           perFPOC |   .0126637   .0112604     1.12   0.261    -.0094062    .0347336
                   |
partyGrp#c.perFPOC |
             Whig  |  -.0178478    .016096    -1.11   0.268    -.0493954    .0136998
      Third-Party  |  -.0027268   .0910423    -0.03   0.976    -.1811666    .1757129
                   |
             ideal |   .1215759   .0368529     3.30   0.001     .0493455    .1938063
      perLibertyFS |    .010432   .0035731     2.92   0.004     .0034289    .0174351
    electionMargin |   .0004903    .099745     0.00   0.996    -.1950064    .1959869
            perMfg |   .0027085   .0031948     0.85   0.397    -.0035532    .0089703
             _cons |   .1269657   .0642338     1.98   0.048     .0010699    .2528616
-------------------+----------------------------------------------------------------
           sigma_u |  .19329375
           sigma_e |  .37579837
               rho |  .20921175   (fraction of variance due to u_i)
------------------------------------------------------------------------------------
(est5 stored)

. ** Model 6 - 1856-1869 (North & Congress)
. eststo: xtreg bsuff i.partyGrp##c.perFPOC ideal electionMargin if year>1855     ///
>         & year<=1870, fe vce(boot, reps(500) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (500)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
...............x......x..............x.x.....x.x.x    50
..xx.x..x...x.......x.........x.......xx........x.   100
......x............x......x..x.......x....x.......   150
x..xx..............x...........x................x.   200
....x.....x..........................x...........x   250
x...........x......................x.x.........x..   300
..x...xx......x...............x...................   350
...........x...............................xx...x.   400
.........x.................................x......   450
x....x............x............x..................   500

Fixed-effects (within) regression               Number of obs      =      1242
Group variable: group                           Number of groups   =         8

R-sq:  within  = 0.6490                         Obs per group: min =        39
       between = 0.1263                                        avg =     155.3
       overall = 0.6324                                        max =       383

                                                Wald chi2(9)       =   2826.43
corr(u_i, Xb)  = 0.0180                         Prob > chi2        =    0.0000

                                         (Replications based on 8 clusters in group)
------------------------------------------------------------------------------------
                   |   Observed   Bootstrap                         Normal-based
             bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
          partyGrp |
      Third-Party  |   .6411065   .2594983     2.47   0.013     .1324992    1.149714
       Republican  |   .5271017   .1748822     3.01   0.003     .1843389    .8698645
         Unionist  |  -.0750674   .2136684    -0.35   0.725    -.4938498     .343715
                   |
           perFPOC |  -.0062329    .007435    -0.84   0.402    -.0208052    .0083394
                   |
partyGrp#c.perFPOC |
      Third-Party  |   -.047319   .0560165    -0.84   0.398    -.1571094    .0624714
       Republican  |    .009995   .0235234     0.42   0.671      -.03611       .0561
         Unionist  |  -.0009249   .0261184    -0.04   0.972    -.0521161    .0502664
                   |
             ideal |   .1524086   .0699202     2.18   0.029     .0153676    .2894497
    electionMargin |   .0522005   .0928147     0.56   0.574    -.1297129    .2341139
             _cons |   .1963355   .0905813     2.17   0.030     .0187994    .3738715
-------------------+----------------------------------------------------------------
           sigma_u |  .19626475
           sigma_e |  .27900547
               rho |  .33102921   (fraction of variance due to u_i)
------------------------------------------------------------------------------------
(est6 stored)

. 
. esttab using "FinalFiles\Tables\Table1.rtf", se(2)  drop(1.partyGrp                             ///
>         1.partyGrp#c.perFPOC 54.icpsrstate 47.icpsrstate)                                               ///
>         order(4.partyGrp 2.partyGrp 3.partyGrp 5.partyGrp 6.partyGrp ideal              ///
>         perFPOC  perEnslaved  perLibertyFS perMfg 4.partyGrp#c.perFPOC                  ///
>         2.partyGrp#c.perFPOC 3.partyGrp#c.perFPOC 5.partyGrp#c.perFPOC                  ///
>         6.partyGrp#c.perFPOC) label                                                                                     ///
>         title(Predictors of Support for Black Suffrage)                                                 ///
>         addnotes("State-Year FE in all but (3) where only two states were included; a state-dummy (not shown) was included.")   ///
>         mtitles("1785-1825 (North)" "1785-1825 (South & Congress)" "1830-1840 (South)"  "1830-1855 (North)"     "1830-1855 (North)"     "185
> 6-1869 (North & Congress)") nogaps nodepvars        ///
>         star(+ 0.1 * 0.05 ** 0.01 *** 0.001) compress ///
>         stats(N r2 chi2, star(chi2) fmt(%9.0g %9.3f)) b(a2) replace
(note: file FinalFiles\Tables\Table1.rtf not found)
(output written to FinalFiles\Tables\Table1.rtf)

. eststo drop est*
(est1 dropped)
(est2 dropped)
(est3 dropped)
(est4 dropped)
(est5 dropped)
(est6 dropped)

. 
. ********************************************************************************
. ***
. ***
. *** Table 2 and Figure 4
. gen interaction = perEnslaved
(191 missing values generated)

. label variable interaction "IV"

. ** Model 1 - Slavery in South
. eststo: xtreg bsuff i.partyGrp##c.interaction ideal perFPOC if south==1,        ///
>         fe vce(boot, reps(400) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (400)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
....x.....x....x..x..........................x....    50
........xxx..x............x............x......x..x   100
...........xx...x..x........x.x......x......xx.x..   150
...........x.....x.x.........................x....   200
.xx......................x.......x.........xx.....   250
..x.............x..........x.........xx....x......   300
.......x...x...x....x..............xx.....x..x.x..   350
...............x...........x........x.......x...x.   400

Fixed-effects (within) regression               Number of obs      =       315
Group variable: group                           Number of groups   =         5

R-sq:  within  = 0.0979                         Obs per group: min =        22
       between = 0.0693                                        avg =      63.0
       overall = 0.0981                                        max =       100

                                                Wald chi2(7)       =    171.86
corr(u_i, Xb)  = -0.0402                        Prob > chi2        =    0.0000

                                             (Replications based on 5 clusters in group)
----------------------------------------------------------------------------------------
                       |   Observed   Bootstrap                         Normal-based
                 bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------+----------------------------------------------------------------
              partyGrp |
                 Whig  |   .2774513    .113266     2.45   0.014     .0554541    .4994485
           Federalist  |  -.2815985   .1301738    -2.16   0.031    -.5367345   -.0264624
                       |
           interaction |  -.0057034   .0015021    -3.80   0.000    -.0086475   -.0027592
                       |
partyGrp#c.interaction |
                 Whig  |  -.0089944   .0043885    -2.05   0.040    -.0175957   -.0003931
           Federalist  |   .0043004   .0024458     1.76   0.079    -.0004932     .009094
                       |
                 ideal |  -.0195584    .091814    -0.21   0.831    -.1995105    .1603937
               perFPOC |  -.0101525   .0078721    -1.29   0.197    -.0255816    .0052765
                 _cons |   .5463216    .081655     6.69   0.000     .3862808    .7063623
-----------------------+----------------------------------------------------------------
               sigma_u |  .12195872
               sigma_e |  .43469583
                   rho |  .07297065   (fraction of variance due to u_i)
----------------------------------------------------------------------------------------
(est1 stored)

. ** Panel (a) of Figure 4
. margins,  at(interaction = (0 40)) over(i.partyGrp)

Predictive margins                                Number of obs   =        315
Model VCE    : Bootstrap

Expression   : Linear prediction, predict()
over         : partyGrp

1._at        : 1.partyGrp
                   interaction     =           0
               2.partyGrp
                   interaction     =           0
               4.partyGrp
                   interaction     =           0

2._at        : 1.partyGrp
                   interaction     =          40
               2.partyGrp
                   interaction     =          40
               4.partyGrp
                   interaction     =          40

-------------------------------------------------------------------------------
              |            Delta-method
              |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
 _at#partyGrp |
1#Democratic  |    .530232   .0949795     5.58   0.000     .3440755    .7163884
      1#Whig  |   .8133878   .1051189     7.74   0.000     .6073585    1.019417
1#Federalist  |   .1903698   .0634116     3.00   0.003     .0660853    .3146543
2#Democratic  |   .3020976    .050488     5.98   0.000     .2031429    .4010523
      2#Whig  |   .2254765   .1003778     2.25   0.025     .0287396    .4222135
2#Federalist  |   .1342521   .0966281     1.39   0.165    -.0551354    .3236396
-------------------------------------------------------------------------------

. marginsplot,                                                                                                                            ///
>         ci1opts(lw(thin) lc(black) lp(solid))                                                                   ///
>         ci2opts(lw(thin) lc(black) lp(dash))                                                                    ///
>         ci3opts(lw(thin) lc(gs7) lp(shortdash))                                                                 ///
>         plot1opts(col(black) lw(thin) lc(black) lp(solid))                                              ///
>         plot2opts(col(white) mlc(black) mlw(thin) lw(thin) lc(black) lp(dash))  ///
>         plot3opts(col(white) msy(T) mlc(black) mlw(thin) lw(thin) lc(gs7) lp(shortdash))        ///
>         ylabel(0(.2)1,labsize(small) angle(h) nogrid)                                                   ///
>         xlabel(, labsize(small))                                                                                                ///
>         graphregion(col(white))                                                                                                 ///
>         ytitle("Probability of Voting for Black Suffrage", size(small))                 ///
>         xtitle("Percent of District Held in Slavery", size(small))                              ///
>         title("Slavery in Southern States, 1800-1835", size(small) col(black))  ///
>         legend(pos(6) col(3) size(small) region(col(none)) lcol(none)  symxsize(huge)   ///
>                 order(4 5 6) label(4 "Democrats") label(5 "Whigs") label(6 "Federalists"))      ///
>         name(figure4a, replace)

  Variables that uniquely identify margins: interaction partyGrp

. ** Model 2 - Slavery in North, before 1825
. eststo: xtreg bsuff i.partyGrp##c.interaction ideal perFPOC if south==0 &       ///
>         year<=1825, fe vce(boot, reps(400) seed(10101)) 
(running xtreg on estimation sample)

Bootstrap replications (400)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400

Fixed-effects (within) regression               Number of obs      =       578
Group variable: group                           Number of groups   =         6

R-sq:  within  = 0.0736                         Obs per group: min =        36
       between = 0.0685                                        avg =      96.3
       overall = 0.0302                                        max =       250

                                                Wald chi2(5)       =     13.20
corr(u_i, Xb)  = -0.4357                        Prob > chi2        =    0.0216

                                             (Replications based on 6 clusters in group)
----------------------------------------------------------------------------------------
                       |   Observed   Bootstrap                         Normal-based
                 bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------+----------------------------------------------------------------
              partyGrp |
           Federalist  |  -.0155498   .1402608    -0.11   0.912    -.2904559    .2593564
           interaction |  -.0375713   .0153397    -2.45   0.014    -.0676366   -.0075059
                       |
partyGrp#c.interaction |
           Federalist  |  -.0018882   .0243752    -0.08   0.938    -.0496627    .0458863
                       |
                 ideal |   .0757371   .0627153     1.21   0.227    -.0471826    .1986569
               perFPOC |   .0133837    .014096     0.95   0.342     -.014244    .0410115
                 _cons |   .5262395   .1175705     4.48   0.000     .2958056    .7566734
-----------------------+----------------------------------------------------------------
               sigma_u |    .225023
               sigma_e |  .46834101
                   rho |  .18755317   (fraction of variance due to u_i)
----------------------------------------------------------------------------------------
(est2 stored)

. ** Model 3 - Liberty Party in 1844
. replace interaction = perLib1844
(3929 real changes made, 2275 to missing)

. eststo: xtreg bsuff i.partyGrp##c.interaction ideal perFPOC perMfg                      ///
>         if year>1830 & year<=1855, fe vce(boot, reps(400) seed(10101))  
(running xtreg on estimation sample)

Bootstrap replications (400)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
....................................x.............   300
..................................................   350
.........................................x........   400

Fixed-effects (within) regression               Number of obs      =      1142
Group variable: group                           Number of groups   =         9

R-sq:  within  = 0.3245                         Obs per group: min =        54
       between = 0.0010                                        avg =     126.9
       overall = 0.2685                                        max =       223

                                                Wald chi2(8)       =    340.85
corr(u_i, Xb)  = -0.0549                        Prob > chi2        =    0.0000

                                             (Replications based on 9 clusters in group)
----------------------------------------------------------------------------------------
                       |   Observed   Bootstrap                         Normal-based
                 bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------+----------------------------------------------------------------
              partyGrp |
                 Whig  |   .2295312   .0632946     3.63   0.000     .1054761    .3535862
          Third-Party  |   .5025586    .281415     1.79   0.074    -.0490046    1.054122
                       |
           interaction |   .0219621   .0119405     1.84   0.066    -.0014408     .045365
                       |
partyGrp#c.interaction |
                 Whig  |   .0061059   .0183088     0.33   0.739    -.0297788    .0419905
          Third-Party  |   .0060605   .0268313     0.23   0.821    -.0465278    .0586488
                       |
                 ideal |   .0931054   .0444868     2.09   0.036      .005913    .1802978
               perFPOC |    .007501   .0088128     0.85   0.395    -.0097718    .0247739
                perMfg |   .0035643   .0042691     0.83   0.404     -.004803    .0119317
                 _cons |   .1124737   .0546545     2.06   0.040     .0053528    .2195946
-----------------------+----------------------------------------------------------------
               sigma_u |   .1881324
               sigma_e |  .37719948
                   rho |  .19920726   (fraction of variance due to u_i)
----------------------------------------------------------------------------------------
(est3 stored)

. ** Model 4 - Free Soil in 1848
. replace interaction = perFS1848
(2526 real changes made, 953 to missing)

. eststo: xtreg bsuff i.partyGrp##c.interaction ideal perFPOC perMfg                      ///
>         if year>1830 & year<=1855, fe vce(boot, reps(400) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (400)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
.............................x....................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
....x.............................................   400

Fixed-effects (within) regression               Number of obs      =       924
Group variable: group                           Number of groups   =        10

R-sq:  within  = 0.4048                         Obs per group: min =        25
       between = 0.1609                                        avg =      92.4
       overall = 0.3717                                        max =       174

                                                Wald chi2(8)       =    624.73
corr(u_i, Xb)  = -0.0282                        Prob > chi2        =    0.0000

                                            (Replications based on 10 clusters in group)
----------------------------------------------------------------------------------------
                       |   Observed   Bootstrap                         Normal-based
                 bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------+----------------------------------------------------------------
              partyGrp |
                 Whig  |   .0782927     .10219     0.77   0.444     -.121996    .2785814
          Third-Party  |   .3558025   .2116495     1.68   0.093    -.0590229     .770628
                       |
           interaction |   .0045897   .0024798     1.85   0.064    -.0002706      .00945
                       |
partyGrp#c.interaction |
                 Whig  |   .0108948   .0054588     2.00   0.046     .0001958    .0215938
          Third-Party  |   .0083754   .0042846     1.95   0.051    -.0000222    .0167731
                       |
                 ideal |    .144896   .0437929     3.31   0.001     .0590635    .2307286
               perFPOC |   .0037536   .0150825     0.25   0.803    -.0258075    .0333147
                perMfg |   .0064578   .0051923     1.24   0.214    -.0037189    .0166345
                 _cons |   .1920459   .0675812     2.84   0.004     .0595891    .3245027
-----------------------+----------------------------------------------------------------
               sigma_u |  .17602529
               sigma_e |   .3572012
                   rho |  .19539269   (fraction of variance due to u_i)
----------------------------------------------------------------------------------------
(est4 stored)

. ** Panel (b) of Figure 4
. margins,  at(interaction = (0 25)) over(i.partyGrp)

Predictive margins                                Number of obs   =        924
Model VCE    : Bootstrap

Expression   : Linear prediction, predict()
over         : partyGrp

1._at        : 1.partyGrp
                   interaction     =           0
               2.partyGrp
                   interaction     =           0
               3.partyGrp
                   interaction     =           0

2._at        : 1.partyGrp
                   interaction     =          25
               2.partyGrp
                   interaction     =          25
               3.partyGrp
                   interaction     =          25

--------------------------------------------------------------------------------
               |            Delta-method
               |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
  _at#partyGrp |
 1#Democratic  |   .1381969   .0402354     3.43   0.001      .059337    .2170568
       1#Whig  |    .452256   .1337861     3.38   0.001     .1900401    .7144719
1#Third-Party  |   .7060498   .1991176     3.55   0.000     .3157866    1.096313
 2#Democratic  |   .2529396   .0820286     3.08   0.002     .0921665    .4137127
       2#Whig  |   .8393677   .0835444    10.05   0.000     .6756237    1.003112
2#Third-Party  |   1.030178   .1361595     7.57   0.000     .7633107    1.297046
--------------------------------------------------------------------------------

. marginsplot,                    ///
>         ci1opts(lw(thin) lc(black) lp(solid))                                                                   ///
>         ci2opts(lw(thin) lc(black) lp(dash))                                                                    ///
>         ci3opts(lw(thin) lc(gs7) lp(shortdash))                                                                 ///
>         plot1opts(col(black) lw(thin) lc(black) lp(solid))                                              ///
>         plot2opts(col(white) mlc(black) mlw(thin) lw(thin) lc(black) lp(dash))  ///
>         plot3opts(col(white) msy(T) mlc(black) mlw(thin) lw(thin) lc(gs7)               ///
>         lp(shortdash))  ylabel(0(.2)1,labsize(small) angle(h) nogrid)                   ///
>         xlabel(, labsize(small))                                                                                                ///
>         graphregion(col(white))                                                                                                 ///
>         ytitle("Probability of Voting for Black Suffrage", size(small))                 ///
>         xtitle("District Vote for Free Soil", size(small)) title("Free Soil", size(small) col(black))   ///
>         legend(pos(6) col(3) size(small) region(col(none)) lcol(none)  symxsize(huge)   ///
>                 order(4 5 6) label(4 "Democrats") label(5 "Whigs") label(6 "Third Party"))      ///
>         name(figure4b, replace)

  Variables that uniquely identify margins: interaction partyGrp

. ** Model 5 - Manufacturing
. replace interaction = perMfg
(3622 real changes made, 436 to missing)

. xtreg bsuff i.partyGrp##c.interaction ideal perFPOC perLibertyFS                        ///
>         if year>1830 & year<=1870, fe vce(boot, reps(400) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (400)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400

Fixed-effects (within) regression               Number of obs      =      1669
Group variable: group                           Number of groups   =        14

R-sq:  within  = 0.3807                         Obs per group: min =        25
       between = 0.0404                                        avg =     119.2
       overall = 0.3349                                        max =       223

                                                Wald chi2(8)       =    330.80
corr(u_i, Xb)  = -0.0738                        Prob > chi2        =    0.0000

                                            (Replications based on 14 clusters in group)
----------------------------------------------------------------------------------------
                       |   Observed   Bootstrap                         Normal-based
                 bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------+----------------------------------------------------------------
              partyGrp |
                 Whig  |   .1045257   .0872749     1.20   0.231      -.06653    .2755813
          Third-Party  |    .411512   .1033159     3.98   0.000     .2090165    .6140074
                       |
           interaction |  -.0037352   .0030951    -1.21   0.228    -.0098015    .0023311
                       |
partyGrp#c.interaction |
                 Whig  |   .0128358   .0061724     2.08   0.038     .0007381    .0249336
          Third-Party  |   .0061344   .0152094     0.40   0.687    -.0236754    .0359443
                       |
                 ideal |   .1320206   .0418423     3.16   0.002     .0500113    .2140299
               perFPOC |   .0030707   .0086367     0.36   0.722    -.0138569    .0199982
          perLibertyFS |   .0096185   .0030347     3.17   0.002     .0036706    .0155663
                 _cons |     .19964   .0670266     2.98   0.003     .0682703    .3310097
-----------------------+----------------------------------------------------------------
               sigma_u |  .18750906
               sigma_e |   .3633284
                   rho |  .21032628   (fraction of variance due to u_i)
----------------------------------------------------------------------------------------

. eststo: xtreg bsuff i.partyGrp##c.interaction ideal perFPOC perLibertyFS        ///
>         if year>1830 & year<=1870, fe vce(boot, reps(400) seed(10101))
(running xtreg on estimation sample)

Bootstrap replications (400)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400

Fixed-effects (within) regression               Number of obs      =      1669
Group variable: group                           Number of groups   =        14

R-sq:  within  = 0.3807                         Obs per group: min =        25
       between = 0.0404                                        avg =     119.2
       overall = 0.3349                                        max =       223

                                                Wald chi2(8)       =    330.80
corr(u_i, Xb)  = -0.0738                        Prob > chi2        =    0.0000

                                            (Replications based on 14 clusters in group)
----------------------------------------------------------------------------------------
                       |   Observed   Bootstrap                         Normal-based
                 bsuff |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------------+----------------------------------------------------------------
              partyGrp |
                 Whig  |   .1045257   .0872749     1.20   0.231      -.06653    .2755813
          Third-Party  |    .411512   .1033159     3.98   0.000     .2090165    .6140074
                       |
           interaction |  -.0037352   .0030951    -1.21   0.228    -.0098015    .0023311
                       |
partyGrp#c.interaction |
                 Whig  |   .0128358   .0061724     2.08   0.038     .0007381    .0249336
          Third-Party  |   .0061344   .0152094     0.40   0.687    -.0236754    .0359443
                       |
                 ideal |   .1320206   .0418423     3.16   0.002     .0500113    .2140299
               perFPOC |   .0030707   .0086367     0.36   0.722    -.0138569    .0199982
          perLibertyFS |   .0096185   .0030347     3.17   0.002     .0036706    .0155663
                 _cons |     .19964   .0670266     2.98   0.003     .0682703    .3310097
-----------------------+----------------------------------------------------------------
               sigma_u |  .18750906
               sigma_e |   .3633284
                   rho |  .21032628   (fraction of variance due to u_i)
----------------------------------------------------------------------------------------
(est5 stored)

. ** Make Table 2
. esttab using "FinalFiles\Tables\Table2.rtf", se(2)  drop(1.partyGrp 5.partyGrp 6.partyGrp 1.partyGrp#c.interaction)     ///
>         order(interaction 4.partyGrp#c.interaction 2.partyGrp#c.interaction 3.partyGrp#c.interaction                            ///
>                   4.partyGrp 2.partyGrp 3.partyGrp 5.partyGrp 6.partyGrp ideal perFPOC perLibertyFS perMfg )                    ///
>         label title(Predictors of Support for Black Suffrage) addnotes("State-Year FE")         ///
>         mtitles("Slavery (South)" "Slavery (North)" "Liberty Party Vote" "Free Soil Vote" "Manufacturing Employment") nogaps nodepvars  ///
>         star(+ 0.1 * 0.05 ** 0.01 *** 0.001) compress ///
>         stats(N r2 chi2, star(chi2) fmt(%9.0g %9.3f)) b(a2) replace
(note: file FinalFiles\Tables\Table2.rtf not found)
(output written to FinalFiles\Tables\Table2.rtf)

. eststo drop est*
(est1 dropped)
(est2 dropped)
(est3 dropped)
(est4 dropped)
(est5 dropped)

. 
. ** Make Figure 4
. graph combine figure4a figure4b, graphregion(col(white)) imargin(tiny)

. graph export "FinalFiles\Figures\Figure4.eps", replace
(note: file FinalFiles\Figures\Figure4.eps not found)
(file FinalFiles\Figures\Figure4.eps written in EPS format)

.  
. ********************************************************************************
. *** Using Referenda.dta file, generate Table 4 and Figure 6
. ***
. ***
. ***
. use  "FinalFiles\Referenda.dta", clear

. 
. *** Table 4 -- Uses Won-ho Park, 2008. �Ecological Inference and Aggregate 
. *** Analysis of Elections.� Ph.D. Dissertation. University of Michigan.
. *** 
. *** .ado files included in file upload.   
. *** Reports voter transition rates or average voter transition rates when 
. *** more than one state is included
. 
. *** Elections with Liberty Party candidates
. egen group1 = group(year icpsrstate) if (icpsrstate==1 | icpsrstate==13)        ///
>         & (year==1846 | year==1847)
(2407 missing values generated)

. avVTR demElection whigElection libElection, second(suffyes suffno suffDrop) group(group1)
There are 2 number of groups
Now going through all the groups.....
vtr[3,3]:  Voter Transition Matrix, Averaged across 2 Groups in group1
           demElection  whigElection   libElection
 suffyes     .08446932     .19319323     .62677019
  suffno     .50754248     .44682304     .03184202
suffDrop     .40798819     .35998373     .34138778

uncond[3,3]:  Unconditional Voter Transition Matrix
           demElection  whigElection   libElection
 suffyes     .04104887     .09326698      .0196009
  suffno     .24664629     .21571064     .00099579
suffDrop      .1982667     .17378764     .01067618

. matrix Liberty = r(vtr)*100

. esttab m(Liberty, fmt(0) transpose) using "FinalFiles\Tables\Table4.rtf", label mlabels(,none)  ///
>         refcat(demElection "New York (1846) and Connecticut (1847)", nolabel)   ///
>         collabels("For Black Suffrage" "Against Black Suffrage" "Did Not Vote") replace
(note: file FinalFiles\Tables\Table4.rtf not found)
(output written to FinalFiles\Tables\Table4.rtf)

. *** Elections with Free Soil Candidates
. egen group2 = group(year icpsrstate) if fsElection!=.
(3680 missing values generated)

. avVTR demElection whigElection fsElection, second(suffyes suffno suffDrop) group(group2)
There are 3 number of groups
Now going through all the groups......
vtr[3,3]:  Voter Transition Matrix, Averaged across 3 Groups in group2
           demElection  whigElection    fsElection
 suffyes     .10706541     .16522461     .58946741
  suffno      .3922701     .48368292     .01572205
suffDrop     .50066449     .35109247     .39481054

uncond[3,3]:  Unconditional Voter Transition Matrix
           demElection  whigElection    fsElection
 suffyes     .04471688     .06548959      .1096253
  suffno     .16383532     .19171598     .00292388
suffDrop     .20910727     .13916149     .07342429

. matrix freesoil = r(vtr)*100

. esttab m(freesoil, fmt(0) transpose) using "FinalFiles\Tables\Table4.rtf", mlabels(,none)               ///
>         refcat(demElection "Wisconsin (1847, 1849) and Michigan (1850)", nolabel) ///
>         collabels(none) label append
(output written to FinalFiles\Tables\Table4.rtf)

. *** Elections with Abolition Candidates
. egen group3 = group(year icpsrstate) if abolElection!=.
(2573 missing values generated)

. avVTR demElection whigElection abolElection, second(suffyes suffno suffDrop) group(group3)
There are 5 number of groups
Now going through all the groups........
vtr[3,3]:  Voter Transition Matrix, Averaged across 5 Groups in group3
           demElection  whigElection  abolElection
 suffyes     .08646198     .19082771     .61181509
  suffno     .49737707     .44994056     .02537935
suffDrop     .41616095     .35923173     .36280556

uncond[3,3]:  Unconditional Voter Transition Matrix
           demElection  whigElection  abolElection
 suffyes     .04141989     .09045733     .02870677
  suffno     .23827005     .21328361     .00119082
suffDrop     .19936321     .17028525     .01702308

. matrix abolition = r(vtr)*100

. esttab m(abolition, fmt(0) transpose) using "FinalFiles\Tables\Table4.rtf", mlabels(,none)              ///
>         refcat(demElection "New York (1846), Connecticut (1847), Wisconsin (1847, 1849), and Michigan (1850)", nolabel) ///
>         collabels(none) label append
(output written to FinalFiles\Tables\Table4.rtf)

. *** Iowa - 1857 
. VTR demElection repElection amerElection if icpsrstate==31, second(suffyes suffno suffDrop ) 

r(vtrmat)[4,4]:  Voter Transition Matrix, Probit, Crude
           demElection   repElection  amerElection           sum
 suffyes     .00369374     .08040487     .00587873          2177
  suffno     .30204996     .18151069     .07720654         13553
suffDrop     .14760655     .20700415     .02941364          8672
     sum         10311         10989          2844         24402

r(n)[3,3]:  Number of Valid Observations
           demElection   repElection  amerElection
 suffyes           124           124           100
  suffno           145           144           116
suffDrop           126           125           105

r(rho)[3,3]:  Probit Correlations, Crude Binary
           demElection   repElection  amerElection
 suffyes    -.65733091     .63812744     -.1675935
  suffno     .40927152    -.43845647     .15326828
suffDrop    -.10634542     .22097358     -.2349621

return(Out)[4,4]:  Voter Transition Rates, Probit, Standardized, Unconditional
           demElection   repElection  amerElection           sum
 suffyes     .00350877     .07952175     .00618349          2177
  suffno     .29098723     .18205917      .0823589         13553
suffDrop     .13256663     .19356322     .02925086          8672
     sum     10421.182     11106.427     2874.3907         24402

return(final)[4,4]:  Voter Transition Rates, Probit, Standardized, Conditional
           demElection   repElection  amerElection           sum
 suffyes     .00821605     .17471772     .05249441          2177
  suffno     .68136899     .40000332     .69918185         13553
suffDrop     .31041496     .42527896     .24832375          8672
     sum     10421.182     11106.427     2874.3907         24402

. matrix Iowa = r(final)*100

. matrix Iowa = Iowa[1..3,1..2]

. esttab m(Iowa, fmt(0) transpose) using "FinalFiles\Tables\Table4.rtf", mlabels(,none)                   ///
>         refcat(demElection "Iowa (1857)", nolabel)                                                              ///
>         collabels(none) label append
(output written to FinalFiles\Tables\Table4.rtf)

. *** Wisconsin - 1857 
. VTR demElection repElection if icpsrstate==25 & year==1857, second(suffyes suffno suffDrop ) 

r(vtrmat)[4,3]:  Voter Transition Matrix, Probit, Crude
          demElection  repElection          sum
 suffyes    .06456493    .30745325        23003
  suffno    .42484744    .12204665        34019
suffDrop    .05988778    .04208597         5182
     sum        45072        45130        62204

r(n)[3,2]:  Number of Valid Observations
          demElection  repElection
 suffyes          377          377
  suffno          388          388
suffDrop          285          285

r(rho)[3,2]:  Probit Correlations, Crude Binary
          demElection  repElection
 suffyes    -.7552562     .7552562
  suffno    .78072451   -.78072452
suffDrop    .12976375   -.12976375

return(Out)[4,3]:  Voter Transition Rates, Probit, Standardized, Unconditional
          demElection  repElection          sum
 suffyes    .05312213    .31667725        23003
  suffno    .40223843    .14465566        34019
suffDrop    .04431794     .0389886         5182
     sum    31082.001    31121.999        62204

return(final)[4,3]:  Voter Transition Rates, Probit, Standardized, Conditional
          demElection  repElection          sum
 suffyes    .10631262    .63294751        23003
  suffno    .80499447     .2891254        34019
suffDrop    .08869291    .07792709         5182
     sum    31082.001    31121.999        62204

. matrix Wisconsin = r(final)*100

. matrix Wisconsin = Wisconsin[1..3,1..2]

. esttab m(Wisconsin, fmt(0) transpose) using "FinalFiles\Tables\Table4.rtf", mlabels(,none)              ///
>         refcat(demElection "Wisconsin (1857)", nolabel)                                                 ///
>         collabels(none) label append
(output written to FinalFiles\Tables\Table4.rtf)

. *** New York - 1860
. VTR demElection repElection if icpsrstate==13 & year==1860, second(suffyes suffno suffDrop ) 

r(vtrmat)[4,3]:  Voter Transition Matrix, Probit, Crude
          demElection  repElection          sum
 suffyes    .01852684    .20406384       321654
  suffno    .29465634    .03861241       481589
suffDrop     .2547417    .19047413       641804
     sum       675020       769755      1445047

r(n)[3,2]:  Number of Valid Observations
          demElection  repElection
 suffyes          928          928
  suffno          928          928
suffDrop          918          918

r(rho)[3,2]:  Probit Correlations, Crude Binary
          demElection  repElection
 suffyes   -.72422387    .72422386
  suffno    .83143617   -.83143615
suffDrop     .2920351    -.2920351

return(Out)[4,3]:  Voter Transition Rates, Probit, Standardized, Unconditional
          demElection  repElection          sum
 suffyes    .01054189     .2120488       321654
  suffno     .2689144    .06435435       481589
suffDrop    .18775833    .25638224       641804
     sum    675147.08    769899.92      1445047

return(final)[4,3]:  Voter Transition Rates, Probit, Standardized, Conditional
          demElection  repElection          sum
 suffyes    .02256327     .3980004       321654
  suffno    .57556932     .1207885       481589
suffDrop    .40186742     .4812111       641804
     sum    675147.08    769899.92      1445047

. matrix NY = r(final)*100

. matrix NY = NY[1..3,1..2]

. esttab m(NY, fmt(0) transpose) using "FinalFiles\Tables\Table4.rtf", mlabels(,none)                     ///
>         refcat(demElection "New York (1860)", nolabel) ///
>         collabels(none) label append addnotes("Voter and average transition rates calculated using Won-ho Park (2008)")
(output written to FinalFiles\Tables\Table4.rtf)

. 
. *** Figure 6
. gen perwhig = whigElection/totElection*100
(2485 missing values generated)

. gen perdem = demElection/totElection*100
(531 missing values generated)

. gen perfs = fsElection/totElection*100
(3680 missing values generated)

. gen perlib = libElection/totElection*100 
(2623 missing values generated)

. gen pergop = repElection/totElection*100
(1776 missing values generated)

. gen peryes = suffyes/sufftot*100
(1437 missing values generated)

. *** Many of the referenda were held immediately before the Free Soil party.
. *** Include the Free Soil results from 1848 for Figure 6 but not ecological 
. *** regression.
. replace perfs = perFS1848 if perfs==.
(167 real changes made)

. *** Figure 6(a)
. regress peryes perwhig  [w=sufftot]
(analytic weights assumed)
(sum of wgt is   4.6281e+05)

      Source |       SS       df       MS              Number of obs =     743
-------------+------------------------------           F(  1,   741) =    7.34
       Model |  2792.55791     1  2792.55791           Prob > F      =  0.0069
    Residual |   282006.55   741  380.575641           R-squared     =  0.0098
-------------+------------------------------           Adj R-squared =  0.0085
       Total |  284799.108   742  383.826291           Root MSE      =  19.508

------------------------------------------------------------------------------
      peryes |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     perwhig |  -.2238707    .082645    -2.71   0.007     -.386117   -.0616245
       _cons |   36.64381   3.950358     9.28   0.000     28.88858    44.39904
------------------------------------------------------------------------------

. loc r2 = round(e(r2), 0.001)

. tw      (scatter peryes perwhig [w=sufftot], msy(oh) mlc(black) mlw(vvthin))    ///
>         (lfit peryes perwhig, lc(black))        ///
>         , graphregion(col(white)) ylab(0(20)100, angle(h) labsize(small) nogrid)        ///
>         xlab(0(20)100, labsize(small)) ytitle("Vote for Black Suffrage", size(small))   ///
>         xtitle("Party Vote", size(small))       text(90 85 "R-Squared = `r2'", size(small))     ///
>         legend(col(2) size(small) region(col(none)) lcol(none)  symxsize(medium)        ///
>                 label(1 "District Vote, Weighted by Size") label(2 "Linear Trend"))     ///
>         name(figure6a, replace) title("Whig", col(black) size(small))
(analytic weights assumed)
(analytic weights assumed)
(analytic weights assumed)

. *** Figure 6(b)
. regress peryes perdem  [w=sufftot] if year<1855
(analytic weights assumed)
(sum of wgt is   4.6281e+05)

      Source |       SS       df       MS              Number of obs =     743
-------------+------------------------------           F(  1,   741) =  177.54
       Model |   55047.735     1   55047.735           Prob > F      =  0.0000
    Residual |  229751.373   741  310.055833           R-squared     =  0.1933
-------------+------------------------------           Adj R-squared =  0.1922
       Total |  284799.108   742  383.826291           Root MSE      =  17.608

------------------------------------------------------------------------------
      peryes |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      perdem |   -.998369   .0749275   -13.32   0.000    -1.145465   -.8512735
       _cons |   74.74967   3.706377    20.17   0.000     67.47342    82.02592
------------------------------------------------------------------------------

. loc r2 = round(e(r2), 0.001)

. tw      (scatter peryes perdem [w=sufftot] if year<1855, msy(oh) mlc(black) mlw(vvthin))        ///
>         (lfit peryes perdem if year<1855, lc(black))    ///
>         , graphregion(col(white)) ylab(0(20)100, angle(h) labsize(small) nogrid)        ///
>         xlab(0(20)100, labsize(small)) ytitle("Vote for Black Suffrage", size(small))   ///
>         xtitle("Party Vote", size(small))       text(90 85 "R-Squared = `r2'", size(small))     ///
>         legend(col(2) size(small) region(col(none)) lcol(none)  symxsize(medium)        ///
>                         label(1 "District Vote, Weighted by Size") label(2 "Linear Trend"))     ///
>         name(figure6b, replace) title("Democratic (pre-1856)", col(black) size(small))          
(analytic weights assumed)
(analytic weights assumed)
(analytic weights assumed)

. *** Figure 6(c)                 
. regress peryes perlib  [w=sufftot]
(analytic weights assumed)
(sum of wgt is   4.1024e+05)

      Source |       SS       df       MS              Number of obs =     658
-------------+------------------------------           F(  1,   656) =  614.95
       Model |   108093.97     1   108093.97           Prob > F      =  0.0000
    Residual |  115308.802   656  175.775613           R-squared     =  0.4839
-------------+------------------------------           Adj R-squared =  0.4831
       Total |  223402.772   657   340.03466           Root MSE      =  13.258

------------------------------------------------------------------------------
      peryes |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      perlib |   3.220528    .129869    24.80   0.000     2.965518    3.475537
       _cons |   15.77577   .6352623    24.83   0.000     14.52838    17.02316
------------------------------------------------------------------------------

. loc r2 = round(e(r2), 0.001)

. tempvar yhat

. predict `yhat'
(option xb assumed; fitted values)
(2623 missing values generated)

. tw      (scatter peryes perlib [w=sufftot], msy(oh) mlc(black) mlw(vvthin))     ///
>         (lfit `yhat' perlib if `yhat'<=100, lc(black))  ///
>         , graphregion(col(white)) ylab(0(20)100, angle(h) labsize(small) nogrid)        ///
>         xlab(0(20)100, labsize(small)) ytitle("Vote for Black Suffrage", size(small))   ///
>         xtitle("Party Vote", size(small))       text(90 85 "R-Squared = `r2'", size(small))     ///
>         legend(col(2) size(small) region(col(none)) lcol(none)  symxsize(medium)        ///
>                         label(1 "District Vote, Weighted by Size") label(2 "Linear Trend"))     ///
>         name(figure6c, replace) title("Liberty Party", col(black) size(small))                                          
(analytic weights assumed)
(analytic weights assumed)
(analytic weights assumed)

. *** Figure 6(d)                 
. regress peryes perfs [w=sufftot]
(analytic weights assumed)
(sum of wgt is   6.8280e+04)

      Source |       SS       df       MS              Number of obs =     160
-------------+------------------------------           F(  1,   158) =  158.87
       Model |  43493.1251     1  43493.1251           Prob > F      =  0.0000
    Residual |  43253.8018   158  273.758239           R-squared     =  0.5014
-------------+------------------------------           Adj R-squared =  0.4982
       Total |  86746.9269   159  545.578156           Root MSE      =  16.546

------------------------------------------------------------------------------
      peryes |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       perfs |   1.070109   .0848988    12.60   0.000     .9024263    1.237792
       _cons |   15.96791   1.834116     8.71   0.000     12.34536    19.59046
------------------------------------------------------------------------------

. loc r2 = round(e(r2), 0.001)

. tempvar yhat2

. predict `yhat2'
(option xb assumed; fitted values)
(3513 missing values generated)

. tw      (scatter peryes perfs [w=sufftot], msy(oh) mlc(black) mlw(vvthin))      ///
>         (lfit `yhat2' perfs if `yhat2'<=100, lc(black)) ///
>         , graphregion(col(white)) ylab(0(20)100, angle(h) labsize(small) nogrid)        ///
>         xlab(0(20)100, labsize(small)) ytitle("Vote for Black Suffrage", size(small))   ///
>         xtitle("Party Vote", size(small))       text(90 90 "R-Squared = `r2'", size(small))     ///
>         legend(col(2) size(small) region(col(none)) lcol(none)  symxsize(medium)        ///
>                         label(1 "District Vote, Weighted by Size") label(2 "Linear Trend"))     ///
>         name(figure6d, replace) title("Free Soil Party", col(black) size(small))                
(analytic weights assumed)
(analytic weights assumed)
(analytic weights assumed)

. *** Figure 6(e)
. regress peryes pergop [w=sufftot]
(analytic weights assumed)
(sum of wgt is   8.7571e+05)

      Source |       SS       df       MS              Number of obs =    1474
-------------+------------------------------           F(  1,  1472) = 2400.08
       Model |  347984.364     1  347984.364           Prob > F      =  0.0000
    Residual |  213423.513  1472    144.9888           R-squared     =  0.6198
-------------+------------------------------           Adj R-squared =  0.6196
       Total |  561407.877  1473  381.132299           Root MSE      =  12.041

------------------------------------------------------------------------------
      peryes |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      pergop |   1.279265   .0261125    48.99   0.000     1.228044    1.330487
       _cons |  -32.25431   1.499972   -21.50   0.000    -35.19662     -29.312
------------------------------------------------------------------------------

. loc r2 = round(e(r2), 0.001)

. tempvar yhat3

. predict `yhat3'
(option xb assumed; fitted values)
(1776 missing values generated)

. tw      (scatter peryes pergop [w=sufftot], msy(oh) mlc(black) mlw(vvthin))     ///
>         (lfit `yhat3' pergop if `yhat3'<=100 & `yhat3'>=0, lc(black))   ///
>         , graphregion(col(white)) ylab(0(20)100, angle(h) labsize(small) nogrid)        ///
>         xlab(0(20)100, labsize(small)) ytitle("Vote for Black Suffrage", size(small))   ///
>         xtitle("Party Vote", size(small))       text(90 15 "R-Squared = `r2'", size(small))     ///
>         legend(col(2) size(small) region(col(none)) lcol(none)  symxsize(medium)        ///
>                         label(1 "District Vote, Weighted by Size") label(2 "Linear Trend"))     ///
>         name(figure6e, replace) title("Republican", col(black) size(small))                     
(analytic weights assumed)
(analytic weights assumed)
(analytic weights assumed)

. *** Figure 6(f)         
. regress peryes perdem [w=sufftot] if year>=1856
(analytic weights assumed)
(sum of wgt is   8.7571e+05)

      Source |       SS       df       MS              Number of obs =    1474
-------------+------------------------------           F(  1,  1472) = 2176.66
       Model |  334915.643     1  334915.643           Prob > F      =  0.0000
    Residual |  226492.234  1472  153.867007           R-squared     =  0.5966
-------------+------------------------------           Adj R-squared =  0.5963
       Total |  561407.877  1473  381.132299           Root MSE      =  12.404

------------------------------------------------------------------------------
      peryes |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      perdem |   -1.27624    .027355   -46.65   0.000    -1.329899   -1.222581
       _cons |   95.26428   1.235963    77.08   0.000     92.83984    97.68871
------------------------------------------------------------------------------

. loc r2 = round(e(r2), 0.001)

. tempvar yhat4

. predict `yhat4'
(option xb assumed; fitted values)
(531 missing values generated)

. tw      (scatter peryes perdem [w=sufftot] if year>=1856, msy(oh) mlc(black) mlw(vvthin))       ///
>         (lfit `yhat4' perdem if `yhat4'<=100 & `yhat4'>=0 & year>=1856, lc(black))      ///
>         , graphregion(col(white)) ylab(0(20)100, angle(h) labsize(small) nogrid)        ///
>         xlab(0(20)100, labsize(small)) ytitle("Vote for Black Suffrage", size(small))   ///
>         xtitle("Party Vote", size(small))       text(90 90 "R-Squared = `r2'", size(small))     ///
>         legend(col(2) size(small) region(col(none)) lcol(none)  symxsize(medium)        ///
>                         label(1 "District Vote, Weighted by Size") label(2 "Linear Trend"))     ///
>         name(figure6f, replace) title("Democratic (post-1856)", col(black) size(small))
(analytic weights assumed)
(analytic weights assumed)
(analytic weights assumed)

.         
. ***Figure 6
. grc1leg figure6a figure6b figure6c figure6d figure6e figure6f, graphreg(col(white)) imargin(tiny) cols(2)       ///
>         title("Figure 6: Popular Vote for Black Suffrage, By Party", size(small) color(black))

. graph display Graph, xsize(8.5) ysize(11)

. graph export "FinalFiles\Figures\Figure6.eps", replace
(note: file FinalFiles\Figures\Figure6.eps not found)
(file FinalFiles\Figures\Figure6.eps written in EPS format)

. 
. 
. log close
      name:  <unnamed>
       log:  d:\dab\Dropbox\Documents\CSDP\Black Suffrage\FinalFiles\code\LogBlackSuffrage.log
  log type:  text
 closed on:  26 Feb 2019, 08:22:12
----------------------------------------------------------------------------------------------------------------------------------------------
